<h2>Loan Item</h2>
<div class="errorval"><?php echo validation_errors(); ?>
<?php echo $error; ?></div>
<!-- Loan information -->
<p>To loan an item, enter the Subscriber ID or Subscriber Last Name into the fields below and select the Search Button, then select the subscriber from the list below</p>
<center>
<table>
<tr>
	<th align="right" width=30%>Subscriber Number:</th>
	<td><?php echo form_input('subscriber_id', set_value('subscriber_id')); ?></td>
	<td width="10%"><?php echo form_button('subscriber_id_search', 'Search');?></td>
</tr>
<tr>
	<th align="right">(or) Last Name:</th>
	<td><?php echo form_input('last_name', set_value('last_name')); ?></td>
	<td width="10%"><?php echo form_button('last_name_search', 'Search');?></td>
</tr>
<tr>
	<td colspan="3">
		<p name="subscriber">Please enter subscriber number or subscriber last name.</p>
	</td>
</tr>
</table>

</center>

<script type="text/javascript">
$(document).ready(function() {
		$("[name=subscriber_id_search]").click( function(){
			$.post('<?php echo site_url('staff/jquery/getSubscriberDetailsForAddLoan/subscriber_id/'); ?>', $("[name=subscriber_id]").serialize(), function(data) {
				$('[name=subscriber]').html(data);
			});
		});
		
		$("[name=last_name_search]").click( function(){
			$.post('<?php echo site_url('staff/jquery/getSubscriberDetailsForAddLoan/last_name/'); ?>', $("[name=last_name]").serialize(), function(data) {
				$('[name=subscriber]').html(data);
			});
		}); 
});
</script>